﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using ExamDemo.Models;

namespace ExamDemo.Data
{
    public class Datalnitlizer:DropCreateDatabaseIfModelChanges<ExamDemoContext>
    {
        protected override void Seed(ExamDemoContext db)
        {
            db.Users.AddRange(new List<Users>
            {
                new Users
                {
                    Username="鱼🐟",
                    Password="0424"
                },new Users
                {
                    Username="大象🐘",
                    Password="0916"
                },new Users
                {
                    Username="狒狒🐒",
                    Password="0101"
                },new Users
                {
                    Username="狐狸🦊",
                    Password="2333"
                },
            });

            db.Messages.AddRange(new List<Messages>
            {
                new Messages
                {
                    FromUserId=1,
                    Content="等会去吃韩式冷面吧"
                },new Messages
                {
                    FromUserId=2,
                    Content="会不会被放鸽子哦"
                },new Messages
                {
                    FromUserId=3,
                    Content="不是吧不是吧会有人这么惨？"
                },new Messages
                {
                    FromUserId=4,
                    Content="好热好热"
                },new Messages
                {
                    FromUserId=1,
                    Content="想回家哦"
                }
            });

            db.Comments.AddRange(new List<Comments>
            {
                new Comments
                {
                    FromUserId=1,
                    ToUserId=2,
                    Comment="不会吧"
                },new Comments
                {
                    FromUserId=2,
                    ToUserId=3,
                    Comment="回宿舍吹16°的空调"
                },new Comments
                {
                    FromUserId=3,
                    ToUserId=1,
                    Comment="吃冰淇淋不"
                },new Comments
                {
                    FromUserId=4,
                    ToUserId=4,
                    Comment="有没有人请我喝奶茶啊~~~~~~"
                },
            });

            db.SaveChanges();

            base.Seed(db);
        }
    }
}
